import { BasicFetchResult } from '../model/baseModel';
import { defHttp } from '@/utils/http/axios';

const api = '/flow/instance';
export const startById = (defId: string, params: any) =>
  defHttp.post<BasicFetchResult<any>>({
    url: `${api}/startById/${defId}`,
    params,
  });
export const startByKey = (defKey: string, params: any) =>
  defHttp.post<BasicFetchResult<any>>({
    url: `${api}/startByKey/${defKey}`,
    params,
  });
  export const insLog = (ins: string) =>
    defHttp.get<BasicFetchResult<any>>({
      url: `${api}/log/${ins}`,
    });
// export const add = (params?: any) =>
//   defHttp.post({ url: api + '/save', params });
// export const edit = (params?: any) =>
//   defHttp.post({ url: api + '/edit', params });
// export const del = (ids: string[]) =>
//   defHttp.post({ url: api + '/delete', params: ids });
// export const exp = (params?: any) => {
//   return new Promise<void>((resolve, reject) => {
//     defHttp
//       .get(
//         { responseType: 'blob', url: api + '/export', params },
//         { isReturnNativeResponse: true }
//       )
//       .then((res) => {
//         downloadBlob(res);
//         resolve();
//       })
//       .catch(() => {
//         reject();
//       });
//   });
// };
